package com.home_school_platform.service.impl;


import com.home_school_platform.dao.AchievementDao;
import com.home_school_platform.dao.AchievementTitleDao;
import com.home_school_platform.entity.pojo.Achievement;
import com.home_school_platform.entity.pojo.AchievementTitle;
import com.home_school_platform.result.Result;
import com.home_school_platform.service.AchievementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 成绩的业务逻辑层
 * @author 卓汉杰
 * */
@Service
public class AchievementServiceImpl implements AchievementService {

    /**
     * 成绩标题
     * */
    @Autowired
    AchievementTitleDao achievementTitleDao;

    /**
     * 成绩
     * */
    @Autowired
    AchievementDao achievementDao;







    @Override
    public Result insertAchievementTitle(AchievementTitle achievementTitle) {

        Map<String,Object> data = new HashMap<>();

        //把数据通过dao保存到数据库
        Integer integer = achievementTitleDao.insertAchievementTitle(achievementTitle);

        //判断是否添加成功
        if (integer == 1){
            return new Result(null,Result.OK,"添加成功");
        }else {
            return new Result(null,Result.NULL,"添加失败");
        }
    }

    /**
     * 获取成绩标题
     * */
    @Override
    public Result listAchievementTitle(Integer teamId) {

        achievementTitleDao.listAchievementTitleByTeamId()

        return null;
    }

    @Override
    public Result insertAchievement(Achievement achievement) {
        return null;
    }

    @Override
    public Result updateAchievement(Achievement achievement) {
        return null;
    }

    @Override
    public Result deleteAchievement(Integer studentId) {
        return null;
    }

    @Override
    public Result getAchievementByStudentId(Integer student) {
        return null;
    }

    @Override
    public Result getAchievementByTeamId(Integer teamId) {
        return null;
    }
}
